#!/bin/bash

# docker exec command
docker_exec () {
    echo "\033[32m"$@" \033[0m"
    $@
}

# The docker container run list
create_network () {
    DENET=`docker network ls | grep -o 'denet'`
    # 检查是否创建网络
    if [ "${DENET}" = '' ]; then
        # 创建网络模式
        DOCKER_CMD="docker network create -d bridge \
            --subnet 10.2.2.0/24 \
            --gateway 10.2.2.1 \
            denet"
        docker_exec $DOCKER_CMD
    else
        echo 'Already created denet';
    fi
}

machine () {
    machine=$( uname -m )
    if [ "${machine}" = "x86_64" ]; then
        machine=""
    fi
    echo "$machine"
}

tag () {
    machine=$( uname -m )
    if [ "${machine}" = "x86_64" ]; then
        latest=":latest"
    else
        latest=":arm"
    fi
    echo "$latest"
}

. ./docker/decezz.sh

. ./docker/official.sh

. ./docker/verified.sh

. ./docker/general.sh
